<template>
    <div>
        <div class="model-mask" v-if="showModel">
            <transition name="modelbox">
                <div class="modelbox">
                    <div class="modelbox-header">
                        <div class="title">
                            <img src="../assets/logoa.png" />
                        </div>
                        <i class="iconfont icon-guanbi" @click="close"></i>
                    </div>
                    <div class="modelbox-content">
                        {{content}}
                    </div>
                    <div class="modelbox-footer">
                        <div class="modelbox-footer-leftbtn" @click="leftClick">{{leftName}}</div>
                        <div class="modelbox-footer-rightbtn" @click="rightClick">{{rightName}}</div>
                    </div>
                </div>
            </transition>  
        </div>
    </div>
</template>
<script>
export default {
    name: 'model',
    props: ['title', 'content', 'leftName', 'rightName', 'showModel'],
    data() {
        return {
            

        }
    },
    methods: {
        leftClick() {
            this.$emit('leftClick');
        },
        rightClick() {
            this.$emit('rightClick');
        },
        close(){
            this.$emit('closeClick');
        }
    }
}
</script>
<style lang='scss'>
.model-mask {
    width: 100%;
    height: 100Vh;
    background: rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 11;
}

.modelbox {
    position: absolute;
    left: 50%;
    border-radius: 0.24rem;
    overflow: hidden;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8.66rem;
    height: 5.75rem;
    &-header {
        .title {
            font-size: 0.8rem;
        }

        width: 100%;
        height: 1.6rem;
        background: #d8fcff;
        line-height: 1.6rem;
        img {
            width: 3.32rem;
            height: 0.94rem;
            margin-top: 0.25rem;
            margin-top: 0.36rem;
        }
        .iconfont{
            position: absolute;
            right:0.34rem;
            top:0.1rem;
            font-size: 0.7rem;
        }
    }
    &-content {
        height: 3rem;
        background: #fff;
        padding: 1.2rem 0;
        box-sizing: border-box;
        font-size: 0.4rem;
    }
    &-footer {
        &-leftbtn {
            float: left;
            width: 50%;
            height: 1.2rem;
            line-height: 1.1rem;
            background: #f4f4f4;
            font-size: 0.38rem;
            color: #959595;
        }
        &-rightbtn {
            float: right;
            width: 50%;
            height: 1.2rem;
            line-height: 1.1rem;
            background: #30ccdb;
            font-size: 0.38rem;
            color: #fff;
        }
    }
}

.modelbox-enter-active, .modelbox-leave-active {
  transition: opacity 3s
}
.modelbox-enter, .modelbox-leave-active {
  opacity: 0
}
</style>

